#include "Helpers/CommandLineArguments.h"
#include "Helpers/FileHelper.h"
#include "Minecraft/File Helpers/FileLoader.h"
#include "Helpers/FileFinder.h"
#include "Rendering/BoxRenderer.h"
#include "NonWindow.h"
#include "Minecraft/Containers/Chunk.h"
#include <conio.h>
using namespace std;

int main(int argc, char **argv)
{
	CommandLineArguments &CLA = CommandLineArguments::GetInstance();
	CLA.Add("h", "Prints out help message.", &PrintHelp);
	if (CLA.Parse(argc, argv) == false)
		return -1;

	// Very nicely outputs a large black texture :
	MakeWindow();

	//{
	//	char *fileName = "ref/Level.dat";
	//	MinecraftFile mcFile;
	//	mcFile.Load(fileName);
	//	mcFile.Decode();
	//	mcFile.WriteToText("ref/Level.txt");
	//	return 0;
	//}

	// GetInstance is... broken?  I'm not sure why
	BoxRenderer br;// = BoxRenderer.GetInstance();
	br.Init();

	// File we're going to load
	{
		char* fileName = "C:\\Users\\Public\\world\\";
		FileFinder(fileName);

		/*Chunk testChunk;
		testChunk.Zero();
		testChunk.LoadFromNBT(fileName);

		br.GetDefaultSorter().Sort(&testChunk);

		br.Render("test.png");*/
	}

	return 0;
}